#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>

/**
 * PAT A 1044 Shopping in Mars
 * This solution uses two-pointer method, with time complexity O(N).
 */

int main() {
    // Read values
    int num, amount;
    scanf("%d %d", &num, &amount);
    std::vector<int> values(num);
    for (int i = 0; i < num; i++)
        scanf("%d", &values[i]);

    // Use two pointer method to find substring sum
    int begin = 0, end = 0;
    int sum = 0;
    int minSum = INT32_MAX;
    std::vector<std::pair<int, int> > results;
    while (begin < num) {
        // Add next item if not reaching amount
        if (sum < amount) {
            if (end == num) break; // can never reach amount
            sum += values[end];
            end++;
            continue;
        }

        // Process result if amount is reached
        std::pair<int, int> pair = std::make_pair(begin + 1, end);
        if (sum < minSum) {
            minSum = sum;
            results.clear();
            results.push_back(pair);
        } else if (sum == minSum) 
            results.push_back(pair);
        sum -= values[begin];
        begin++;
    }

    // Print result
    for (int i = 0; i < results.size(); i++)
        printf("%d-%d\n", results[i].first, results[i].second);
    
    return 0;
}

/**
 * The following solution timeouts on 2 cases.
 * This solution has time complexity O(N^2).
 
int main() {
    // Compute sum beginning at 1..n
    int num, amount;
    scanf("%d %d", &num, &amount);
    std::vector<int> sum(num, 0);
    std::vector<std::pair<int, int> > results;
    int begin = 0;
    int minSum = INT32_MAX;
    for (int i = 0; i < num; i++) {
        int val;
        scanf("%d", &val);
        for (int j = begin; j <= i; j++) {
            if (sum[j] >= amount) {
                std::pair<int, int> pair = std::make_pair(j, i - 1);
                if (sum[j] < minSum) {
                    results.clear();
                    results.push_back(pair);
                    minSum = sum[j];
                } else if (sum[j] == minSum)
                    results.push_back(pair);
                begin++;
            } else
                sum[j] += val;
        }
    }
    for (int i = begin; i < num; i++) {
        if (sum[i] >= amount) {
            std::pair<int, int> pair = std::make_pair(i, num - 1);
            if (sum[i] < minSum) {
                results.clear();
                results.push_back(pair);
                minSum = sum[i];
            } else if (sum[i] == minSum)
                results.push_back(pair);
        }
    }

    // Print subsequence reaching the amount
    for (int i = 0; i < results.size(); i++)
        printf("%d-%d\n", results[i].first + 1, results[i].second + 1);

    return 0;
}*/